<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * 会员管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
	$params=array();
	$params['uniacid']=$_SESSION['uniacid'];
	if(!empty($_RQ['name'])){
		$params['name like']='%'.trim($_RQ['name']).'%';
		$return['params']['name']=trim($_RQ['name']);
	}
	if(!empty($_RQ['mobile'])){
		$params['mobile']=trim($_RQ['mobile']);
		$return['params']['mobile']=trim($_RQ['mobile']);
	}
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$fields=array('id','uniacid','notice_type','name','mobile','ewm','show_n','show_m','show_e','status','createtime');
	$list=pdo_getslice('jy_move_member',$params,array($pindex,$psize),$total,$fields,'','id desc');

	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>array(
			array('op'=>'list','title'=>'车主管理'),
		),
		'list'=>array('data'=>'list','edit'=>false,'delall'=>false,'del_one'=>false,'list'=>array(
			array('name'=>'name','title'=>'姓名','type'=>'string'),
			array('name'=>'mobile','title'=>'手机','type'=>'string'),
			array('name'=>'show_n','title'=>'是否显示姓名','type'=>'radio','options'=>'show_n'),
			array('name'=>'show_m','title'=>'是否显示手机号','type'=>'radio','options'=>'show_m'),
			array('name'=>'show_e','title'=>'是否显示微信二维码','type'=>'radio','options'=>'show_e'),
			array('name'=>'status','title'=>'是否禁止','type'=>'radio','options'=>'status'),
			array('name'=>'createtime','title'=>'加入时间','type'=>'time'),
		),'action'=>array(
			array('type'=>'post','op'=>'start','title'=>'取消禁止','message'=>'确定取消禁止该用户吗！','show'=>array('status'=>1)),
			array('type'=>'post','op'=>'off','title'=>'禁止','message'=>'确定禁止该用户吗！','show'=>array('status'=>0)),
		)),
		'search'=>array(
			array('name'=>'name','title'=>'姓名','type'=>'string'),
			array('name'=>'mobile','title'=>'手机号','type'=>'string'),
		)
	);
	$return['show_n']=array('0'=>'否','1'=>'是');
	$return['show_m']=array('0'=>'否','1'=>'是');
	$return['show_e']=array('0'=>'否','1'=>'是');
	$return['status']=array('0'=>'否','1'=>'是');
	$return['htmls']=$htmls;
	exi($return);
}
//取消禁止
if($_RQ['op']=='start'){
	
	$id=intval($_RQ['id']);
	if($id){
		$this->update('member',array('status'=>0),array('id'=>$id));	
	}
	exi('取消禁止成功！');
}
  
if($_RQ['op']=='off'){
	
	$id=intval($_RQ['id']);
	if($id){
		$this->update('member',array('status'=>1),array('id'=>$id));
	}
	exi('禁止成功！');
  }